﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Erp.Migrations
{
    /// <inheritdoc />
    public partial class modify_table_MatlInv_BizId : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "TrdnFlag",
                schema: "Erp",
                table: "MatlInv");

            migrationBuilder.RenameColumn(
                name: "OrdNo",
                schema: "Erp",
                table: "MatlInv",
                newName: "ManuLotnum");

            migrationBuilder.AddColumn<Guid>(
                name: "BizId",
                schema: "Erp",
                table: "MatlInv",
                type: "uuid",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "BizType",
                schema: "Erp",
                table: "MatlInv",
                type: "integer",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "MatlGenname",
                schema: "Erp",
                table: "MatlInfo",
                type: "text",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<string>(
                name: "ProdBarc",
                schema: "Erp",
                table: "MatlInfo",
                type: "text",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "SaluntPric",
                schema: "Erp",
                table: "MatlInfo",
                type: "numeric",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "SaluntPric",
                schema: "Erp",
                table: "InboundDetl",
                type: "numeric(18,4)",
                nullable: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "BizId",
                schema: "Erp",
                table: "MatlInv");

            migrationBuilder.DropColumn(
                name: "BizType",
                schema: "Erp",
                table: "MatlInv");

            migrationBuilder.DropColumn(
                name: "MatlGenname",
                schema: "Erp",
                table: "MatlInfo");

            migrationBuilder.DropColumn(
                name: "ProdBarc",
                schema: "Erp",
                table: "MatlInfo");

            migrationBuilder.DropColumn(
                name: "SaluntPric",
                schema: "Erp",
                table: "MatlInfo");

            migrationBuilder.DropColumn(
                name: "SaluntPric",
                schema: "Erp",
                table: "InboundDetl");

            migrationBuilder.RenameColumn(
                name: "ManuLotnum",
                schema: "Erp",
                table: "MatlInv",
                newName: "OrdNo");

            migrationBuilder.AddColumn<bool>(
                name: "TrdnFlag",
                schema: "Erp",
                table: "MatlInv",
                type: "boolean",
                nullable: false,
                defaultValue: false);
        }
    }
}
